/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
class Solution {
public:
    bool isSymmetric(TreeNode* root) {
        if(!root) return true;
        return isSymmetric(root -> left, root -> right);
    }
    bool isSymmetric(TreeNode* root_l, TreeNode* root_r) {
        if(!root_l && !root_r) return true;
        if(!root_l || !root_r) return false;
        return root_l -> val == root_r -> val && isSymmetric(root_l -> left, root_r -> right) && isSymmetric(root_l -> right, root_r -> left);
    }
};
